Repository navigation
refactor(android): share one package/Activity parser and trim the escape-guard comments - #5030
Conversation
…d comments parseAndroidResumedActivity inlined the same package/Activity regex that the focused-window read uses. Both now use ANDROID_COMPONENT_PATTERN, which captures the activity too. clearAndroidBlockingDialogObservation returns the clear branch of the existing AndroidBlockingDialogObservation type instead of restating it. The escape guard's JSDoc and CONSERVATIVE comment are wrapped and cut down to the invariant.
The permission prompt and Trusted Web Activity cases pin that only an escape surface owning the focus skips the guard, not any package other than the app. The title and a one-line comment now say so.
|
Thanks for trimming these call sites. The code at 9d5fdfd looks correct, and the PR has no blocking findings. The two Body rules checks were cancelled, and the other 15 checks pass. Those two checks only read the PR body, so the cancellation is likely unrelated to the diff. Before merge, re-run the cancelled Body rules checks. Not verified here: the mutation-test claims in the PR body, the Body rules result, and the live Pixel 9 run. Not blocking, and fine to take or leave: the same component regex remains in Could |
The resumed-activity, focused-window and both foreground readers each matched the same package/Activity regex. app-parsers.ts now owns parseAndroidComponent, and every reader passes it the segment it already selected, in its existing marker order. window-state.ts re-exports the contract's AndroidBlockingDialogObservation instead of restating the union, and the helper focus branch in observation.ts builds its clear observation with clearAndroidBlockingDialogObservation.
…side the session app
|
|
Thanks for the update. The code looks good at 9389048. The shared package/Activity parser keeps the same regex text and segments, so the evidence gap from the earlier review is closed by the diff trace. The 15 checks pass and there are no conflicts, so nothing else is needed before merge. Not verified here: the tests and the Pixel 9 AVD were not run, and the 634-segment old/new agreement from the PR body was not reproduced. Neither is needed given the character-identical regex. |
Summary
Follow-up to #5011, from its review:
package/Activityregex.app-parsers.tsnow ownsparseAndroidComponent. Each reader passes it the segment it already selected, in its existing marker order.window-state.tsre-exports the contract'sAndroidBlockingDialogObservationinstead of restating it, and the helper focus branch inobservation.tsusesclearAndroidBlockingDialogObservation.No behaviour change.
Value
platform-android/srcValidation
9389048bb,check:affected --run --head,exactCommit: true: format, lint, typecheck, layering, fallow, build and vitest-related (411 tests) pass.parseAndroidComponenttable tests fail when the regex loses the activity group, the/,$, or the dotted-package rule, or reads past}.parseAndroidComponentagree on all 634 segments from 164 dumpsys lines (test fixtures plus live dumps from a Pixel 9 AVD, Android 16).open,snapshot -i,pressandappstateread the Clock app, then the launcher afterhome. In Chrome, Settings > Notifications opens system Settings:A single press passes: the guard's one read right after the tap still sees Chrome. This PR does not change that read.